package com.blgroup.oa.web.controller;


import com.blgroup.oa.service.GroupService;
import com.blgroup.oa.service.ProcessDefinitionService;
import org.activiti.engine.identity.Group;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;

/**
 * 用户Controller
 *
 * @author tangyulong
 * @version v1.0
 * @ClassName: UserController
 * @date 2018年5月16日 下午11:35:41
 */
@RestController
@RequestMapping(value = "/processDefinition")
public class ProcessDefinitionController extends BaseController {

    @Autowired
    private ProcessDefinitionService processDefinitionService;

    /**
     * 方法描述：   跳转用户组列表页面
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public ModelAndView list(  Model model, HttpServletRequest request) {
        ModelAndView mv = new ModelAndView("pd/pd");
        try {
            List<ProcessDefinition> list = processDefinitionService.list();
            model.addAttribute("pds", list);
        } catch (Exception e) {
            logger.error(e.getMessage());
        }
        return mv;
    }
}
